//package com.rxyb.security.config;
//
//import feign.Feign;
//import okhttp3.ConnectionPool;
//import okhttp3.OkHttpClient;
//import org.springframework.boot.autoconfigure.AutoConfigureBefore;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
//import org.springframework.cloud.openfeign.FeignAutoConfiguration;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.concurrent.TimeUnit;
//
///**
// * @author YJH
// * @version 1.0
// * @description 构建HttpClient
// * @date 2020/5/21  17:23
// */
//@Configuration
//@ConditionalOnClass(value = Feign.class)
//@AutoConfigureBefore(FeignAutoConfiguration.class)
//public class FeignOkHttpConfig {
//
//    @Bean
//    public OkHttpClient okHttpClient() {
//        return new OkHttpClient.Builder()
//                //设置连接时间
//                .connectTimeout(60, TimeUnit.SECONDS)
//                // 设置读取超时
//                .readTimeout(60, TimeUnit.SECONDS)
//                // 设置写入超时
//                .writeTimeout(60, TimeUnit.SECONDS)
//                // 是否自动重连
//                .retryOnConnectionFailure(true)
//                .connectionPool(new ConnectionPool())
//                .build();
//    }
//}
